package cn.zysheep.controller;

import cn.zysheep.annotation.PreAuth;
import cn.zysheep.common.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *
 * </p>
 *
 * @author : lyw
 * @since : 2023/11/23 17:11
 */
@RestController
@RequestMapping("/api")
@Slf4j
public class UserController {


    @GetMapping("/save")
    @PreAuth("@af.hasPermission('ADMIN')")
    public R save() {
        log.info("====执行保存业务逻辑=====");
        return R.success();
    }

    @GetMapping("/get")
    @PreAuth("@af.hasPermission('USER')")
    public R get() {
        log.info("====执行保存业务逻辑=====");
        return R.success();
    }

}
